import request from "../../utils/request";

const BASE_URL = "maimao_goods/goods/comment";
export default {

    /**
     * 发布评论
     */
    publish(comment) {
        return request({
            url: `${BASE_URL}/publish`,
            method: 'post',
            data: comment
        })
    },
    /**
     * 回复评论
     */
    reply(comment) {
        return request({
            url: `${BASE_URL}/reply`,
            method: 'post',
            data: comment
        })
    },
    commentData(page, size, goodsId, filter) {
        return request({
            url: `${BASE_URL}/goods-comments?page=${page}&size=${size}&goodsId=${goodsId}`,
            method: 'post',
            data: filter
        })
    },
    /**
     * 评价中心查询评价
     * @param shopId
     * @param filter
     * @returns {AxiosPromise}
     */
    msComments(page, size, filter) {
        return request({
            url: `${BASE_URL}/ms-comments?page=${page}&size=${size}`,
            method: 'post',
            data: filter
        })
    },
    /**
     * 根据id查询单个评论
     * @param id
     * @returns {AxiosPromise}
     */
    commentOne(id) {
        return request({
            url: `${BASE_URL}/comment-one?id=${id}`,
            method: 'get'
        })
    },
    /**
     * 店铺评价概览聚合统计
     */
    commentAggCount(){
        return request({
            url: `${BASE_URL}/comment-agg`,
            method: 'get'
        })
    },
    /**
     * 店铺评论热词
     * @param shopId
     * @returns {AxiosPromise}
     */
    commentHotWord(shopId){
        return request({
            url:`${BASE_URL}/hot-word?goodsId=${shopId}`,
            method:'get'
        })
    }


}

